package cn.msqweb.service.impl;


import cn.msqweb.entity.ProdComm;
import cn.msqweb.mapper.ProdCommMapper;
import cn.msqweb.service.ProdCommService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.Date;

@Service
public class ProdCommServiceImpl extends ServiceImpl<ProdCommMapper, ProdComm> implements ProdCommService {

    @Resource
    private ProdCommMapper prodCommMapper;
    @Override
    public Boolean replyAndReviewProdComm(ProdComm prodComm) {
        String replyContent = prodComm.getReplyContent();
        if (StringUtils.hasText(replyContent)){
            prodComm.setReplyTime(new Date());
        }
        return prodCommMapper.updateById(prodComm) > 0;
    }
}
